     <template>
         <el-dialog title="请选择学校" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
             <!--查询面板-->
             <SearchPanel ref="searchPanel" :search-config="searchConfig" @startSearch="startSearch"></SearchPanel>

             <!-- 查询结果 -->
             <ResultListPanel tableRef="table" ref="multipleTable" :checkBoxEnable="true" :data="dataList?dataList:[]"
                 :listConfig="resultColConfig" :listLoading="listLoading" @paginationChange="paginationChange"
                 @selectionChange="selectionChange">
                 <el-table-column slot="slotFont0" align="center" min-width="200px" label="学校名称" prop="name">
                     <template slot-scope="scope">
                         <div class="school-name">
                             <img :src="scope.row.logo" alt style="width:40px;height:40px" />
                             <span>{{dataList[scope.$index]['name']}}</span>
                         </div>
                     </template>
                 </el-table-column>
             </ResultListPanel>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="dialogVisible = false">取消</el-button>
                 <el-button type="primary" @click="comfirm()">确定添加</el-button>
             </span>
         </el-dialog>
     </template>
     <script>
         import ResultListPanel from '../ResultListPanel';
         import SearchPanel from '../SearchPanel';
         import API from '../../api';
         import cloneDeep from 'lodash/cloneDeep';
         export default {
             components: {
                 ResultListPanel,
                 SearchPanel
             },
             props: {
                 isMoreSelect: {
                     type: Boolean,
                     default: true
                 }
             },
             data() {
                 return {
                     dialogVisible: false,
                     selectDataList: [],
                     // 搜索项配置
                     searchConfig: [{
                         alias: 'name',
                         name: '请输入学校名称搜索',
                         type: 'input'
                     }],
                     resultColConfig: [{
                         alias: 'code',
                         name: '学校编码',
                         width: '120px'
                     }],
                     listLoading: false, // 数据列表显示状态
                     dataList: [], //  数据列表
                     /* 分页查询数据 */
                     pageSize: 10,
                     pageNum: 1,
                     totalPage: 0,
                     /* 查询条件参数 */
                     dataForm: {
                         name: ''
                     }
                 };
             },
             methods: {
                 comfirm() {
                     if (this.isMoreSelect == false && this.selectDataList.length > 1) {
                         this.$message.error('只能选择一个哟')
                     } else {
                         this.$emit('scelecSchool', this.selectDataList);
                         this.dialogVisible = false;
                     }


                 },
                 handleClose() {
                     this.dialogVisible = false;
                 },
                 /***
                  * 搜索面板出发搜索事件
                  * @param params
                  */
                 startSearch(params) {
                     this.dataForm = params;
                     this.pageNum = 1;
                     this.$set(this.$refs.multipleTable['pageParams'], 'pageNum', 1);
                     this.getSchoolList();
                 },
                 init() {
                     this.dialogVisible = true
                     this.getSchoolList();
                 },
                 selectionChange(val) {
                     this.selectDataList = val;
                 },

                 /**
                  * 分页器发生改变
                  * @param page
                  */
                 paginationChange(page) {
                     this.pageSize = page.pageSize;
                     this.pageNum = page.pageNo;
                     this.getSchoolList();
                 },
                 getSchoolList() {
                     let params = cloneDeep(this.dataForm);
                     params.pageNum = this.pageNum;
                     params.pageSize = this.pageSize;
                     this.listLoading = true;
                     API.common.getSchoolList(params).then(res => {
                         this.listLoading = false;
                         this.totalPage = res.total;
                         this.dataList = res.rows;
                         this.$set(this.$refs.multipleTable['pageParams'], 'total', res.total);
                     });
                 }
             }
         };
     </script>
     <style scoped>
         .school-name {
             display: flex;
             display: -webkit-flex;
             align-items: center;
         }

         .school-name img {
             margin-right: 4px;
         }
     </style>